package com.house.order.service.impl;


import com.common.entity.order.Order;
import com.common.utils.IdWorker;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.house.order.mapper.OrderMapper;
import com.house.order.service.IOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * @author: 温洁宇
 * @date: 2021/08/12/10:50
 * Other:
 */
@Service
public class OrderServiceImpl implements IOrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Autowired
    private IdWorker idWorker;

    @Override
    public PageInfo<Order> findAllPage(Order order, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<Order> list = orderMapper.findAllPage(order);
        PageInfo<Order> orderPageInfo = new PageInfo<>(list);
        return orderPageInfo;
    }

    @Override
    public boolean del(Long id) {

        return orderMapper.del(id);
    }


}
